package org.witsoft.demo.graphql.extend.directive;

import graphql.kickstart.tools.boot.SchemaDirective;
import graphql.language.DirectiveDefinition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.witsoft.demo.graphql.service.AuthenticationService;

@Configuration
public class CustomerDirectives {

    @Bean
    public SchemaDirective isAuthenticatedDirective(AuthenticationService authenticationService) {
        return new SchemaDirective("authenticated", new AuthenticatedDirectiveWiring(authenticationService));
    }

    @Bean
    public SchemaDirective dateFormatDirective() {
       return new SchemaDirective("dateFormat", new DateFormatDirectiveWiring());
    }
}
